package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** GameLevel数据管理 */
public class GameLevelDBModel extends AbstractDBModel<GameLevelDBModel, GameLevelEntity>
{
    private static GameLevelDBModel instance;

    public static GameLevelDBModel getInstance() {
        if (instance == null) {
            instance = new GameLevelDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "GameLevel.data";
    }

    /** 创建实体 */
    @Override
    protected GameLevelEntity MakeEntity(GameDataTableParser parse)
    {
        GameLevelEntity entity = new GameLevelEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.ChapterID = parse.GetFieldValueToInt("ChapterID");
        entity.Name = parse.GetFieldValueToUTF8String("Name");
        entity.SceneName = parse.GetFieldValueToUTF8String("SceneName");
        entity.SmallMapImg = parse.GetFieldValueToUTF8String("SmallMapImg");
        entity.isBoss = parse.GetFieldValueToInt("isBoss");
        entity.Ico = parse.GetFieldValueToUTF8String("Ico");
        entity.PosInMap = parse.GetFieldValueToUTF8String("PosInMap");
        entity.DlgPic = parse.GetFieldValueToUTF8String("DlgPic");
        entity.CameraRotation = parse.GetFieldValueToUTF8String("CameraRotation");
        entity.Audio_BG = parse.GetFieldValueToUTF8String("Audio_BG");
        return entity;
    }
}
